20.03.2011, 09:35
Hi. I'm scripting a little server for myself, I have not scripted anything for a long time tho.
My Pickups save to MySQL and load from there fine, but I need a script, that if you step on the pickups (PickupTypes are 1), you'll be teleported to somewhere else.
My MySQL struct:
Code to spawn pickups
PAWN
It's from [L3th4l]'s gm
Hope you understood my sh*tty English and can help me
Thanks
My Pickups save to MySQL and load from there fine, but I need a script, that if you step on the pickups (PickupTypes are 1), you'll be teleported to somewhere else.
My MySQL struct:
Код:
INSERT INTO `pickups` (`PickupX`, `PickupY`, `PickupZ`, `PickupModel`, `PickupType`)
PAWN
Код:
stock AddPickupFromFile()
{
new
Str[67],
PType,
PModel,
Float:PX,
Float:PY,
Float:PZ,
pTotal;
mysql_query("SELECT * FROM `pickups`");
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row(Str))
{
sscanf(Str, "p<|>fffii", PX, PY, PZ, PModel, PType);
CreateDynamicPickup(PModel, PType, PX, PY, PZ, -1, -1, -1, PICKUPDISTANCE);
pTotal++;
}
}
mysql_free_result();
printf("** %i\t<->\tPickups Loaded From\t<->\tMySQL\t\t **", pTotal);
return 1;
}
stock AddPickupToFile(Float:PX, Float:PY, Float:PZ, PModel, PType)
{
new
Query[200];
format(Query, sizeof(Query), "INSERT INTO `pickups` (PickupX, PickupY, PickupZ, PickupModel, PickupType) VALUES(%f, %f, %f, %d, %d)",
PX, PY, PZ, PModel, PType);
mysql_query(Query);
mysql_free_result();
return 1;
}
Hope you understood my sh*tty English and can help me

Thanks


