HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[ Game Cache ] - [ Store Player ]

08-02-2004, 01:49 AM#1
Beta_Tester
Hi im trying to create a function that can store a player in the game cache but when ever i do it right (i think i did) the WE crashes as i save with the GetStoredPlayer function in the map.

Custom Script:
Code:
StorePlayer takes gamecache cache, string key, string missionKey, player value returns nothing

GetStoredPlayer takes string key, string missionKey, gamecache cache returns player

is there something that im doing wrong or can the WE just not handle this, if so tell me why and how to fix it

Thanks
[ Beta_Tester ]
08-02-2004, 02:19 AM#2
fugly
hmmm try using the return bug

Code:
function  P2I takes player p returns integer
return p
return 0
endfunction

function I2P takes integer x returns player
return x
return null
endfunction

call StoreInteger(udg_gamecache, "category", "label", P2I(GetTriggerPlayer())) will save a player

I2P(GetStoredInteger(udg_gamecache,"category","label")) will return a player

you could even make a function like

function GetStoredPlayer2 takes gamecache x, string category, string label returns    player
return GetStoredInteger(x,category,label)
return null
endfunction

hope this helps
08-02-2004, 06:13 AM#3
TheFirstSword
Quote:
Originally Posted by Beta_Tester
Hi im trying to create a function that can store a player in the game cache but when ever i do it right (i think i did) the WE crashes as i save with the GetStoredPlayer function in the map.

Custom Script:
Code:
StorePlayer takes gamecache cache, string key, string missionKey, player value returns nothing

GetStoredPlayer takes string key, string missionKey, gamecache cache returns player

is there something that im doing wrong or can the WE just not handle this, if so tell me why and how to fix it

Thanks
[ Beta_Tester ]

Check my tutorial here